package com.by.facade.enums.wxCp;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Map;
import java.util.function.Function;
import java.util.stream.Collectors;
import java.util.stream.Stream;

/**
 * @author Tian Wei
 * @version 1.0
 * @date 2024/12/17 15:31
 */
@Getter
@AllArgsConstructor
public enum WxCpTagRelaBusinessRelaTypeEnum {

    COMPLETE_COURSE(WxCpTagRelaBusinessRelaTypeEnum.COMPLETE_COURSE_CODE, "完课","完课标签组","完课D"),
    ATTACH_COURSE(WxCpTagRelaBusinessRelaTypeEnum.ATTACH_COURSE_CODE, "到课","看课标签组","看课D"),
    SYS_TAG_ATOMIC_INFO(WxCpTagRelaBusinessRelaTypeEnum.SYS_TAG_ATOMIC_INFO_CODE, "系统标签(自动打动打)",null,null),
    SYS_TAG_MANUAL_INFO(WxCpTagRelaBusinessRelaTypeEnum.SYS_TAG_MANUAL_INFO_CODE, "系统标签(手动打标签)",null,null),
    ;

    private final Integer type;
    private final String desc;
    private final String prefixWxCpTagGroupName;
    private final String prefixWxCpTagSubName;
    private static final Map<Integer, WxCpTagRelaBusinessRelaTypeEnum> MAP;
    static {
        MAP = Stream.of(WxCpTagRelaBusinessRelaTypeEnum.values()).collect(Collectors.toMap(WxCpTagRelaBusinessRelaTypeEnum::getType, Function.identity()));
    }

    public static WxCpTagRelaBusinessRelaTypeEnum resolveByType(Integer type) {
        return MAP.get(type);
    }

    public static final int COMPLETE_COURSE_CODE = 1;
    public static final int ATTACH_COURSE_CODE = 2;
    public static final int SYS_TAG_ATOMIC_INFO_CODE = 3;
    public static final int SYS_TAG_MANUAL_INFO_CODE = 4;

}
